package streamAndFile;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class ConvertGBK2UTF8 {

 static void convertGBK2UTF8(String src, String dst) throws IOException {
	 BufferedReader br = null;
	 try{
		 FileInputStream fis = new FileInputStream(src);
		 InputStreamReader isr = new InputStreamReader (fis,"UTF-8");
		 br = new BufferedReader(isr);
		 String line = null;
		 PrintWriter pw = null;
		 pw = new PrintWriter(dst);
		 while((line = br.readLine())!=null){
			 pw.print(line);
		 }
		 pw.close();
	 }finally{
		 if(br!= null){
			 br.close();
		 }
	 }
 }
}

		 

